package com.lsq.springboot;

import com.lsq.spring.Component;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @author lsq
 * @description 自动配置类
 * @date 2023/9/8
 */
@Configuration
public class WebServerAutoConfiguration {
    @Bean
    //@Conditional()
    @LsqConditionOnClass("org.eclipse.jetty")
    public JettyWebServer jettyWebServer(){
        return new JettyWebServer();
    }

    @Bean
    //@Conditional(TomcatCondition.class)
    @LsqConditionOnClass("org.apache.catalina.startup.Tomcat")
    public TomcatWebServer tomcatWebServer(){
        return new TomcatWebServer();
    }
}
